import { TaskActInfo } from "./info/TaskActInfo";
import { ConfigManager } from "../../../com/gengine/resource/ConfigManager";
type int = number;
//class TaskActiveConfig
    
    export  class TaskActiveConfig
    {
        constructor()
        {
            
            this._map = new Map<any, any> /* flash.utils.Dictionary */();
            this._lists = new Array<any>();
            if (TaskActiveConfig._instance != null) 
            {
                throw new Error(" DailyItemConfig 单例 ");
            }
            this.init();
            return;
        }

        /* internal  */write(arg1: Object): void
        {
            var loc1=null;
            var loc2=null;
            var loc3=0;
            var loc4=arg1;
            for(loc2 of loc4) 
            {
                loc1 = new TaskActInfo();
                loc1.actCode = loc2.code;
                loc1.color = loc2.color;
                loc1.levelEnd = loc2.levelEnd;
                loc1.priority = loc2.priority;
                this._map[loc2.code] = loc1;
                this._lists.push(loc1);
            }
            this._lists.sortOn("priority", Array.NUMERIC);
            return;
        }

        public init(): void
        {
            var loc1=ConfigManager.instance.getJSONByFileName("t_task_active.json");
            this.write(loc1);
            return;
        }

        public getInfoByType(arg1: int): TaskActInfo
        {
            return this._map[arg1];
        }

        public getInfoList(): Array<any>
        {
            return this._lists;
        }

        public static get instance(): TaskActiveConfig
        {
            if (TaskActiveConfig._instance == null) 
            {
                TaskActiveConfig._instance = new TaskActiveConfig();
            }
            return TaskActiveConfig._instance;
        }

        /* internal */ /* var */_map: Map<any, any> /* flash.utils.Dictionary */;

        /* internal */ /* var */_lists: Array<any>;

        /* internal */ static /* var */_instance: TaskActiveConfig;
    }
